﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Reflexive.IO;
using System.Management;
using Microsoft.Diagnostics.Tracing;

namespace Reflexive.IO
{
    /*
     * Bounding Min or Max
     * Limiting Min and Max
     * Imperative Must be 
     * Bounded Imperative Must be  
     * Transitive
     */
    //http://msdn.microsoft.com/en-us/library/bb427443(VS.85).aspx
    //http://msdn.microsoft.com/en-us/library/bb870973(v=vs.85).aspx
    //http://msdn.microsoft.com/en-us/library/bb513652(v=vs.85).aspx
    public class NoOpTypeConverter<TSource> : TypeConverter, ITypeConverter<TSource, TSource>
    {
        public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
        {
            return typeof(TSource) == sourceType;
        }

        public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
        {
            return Convert((TSource)value);
        }


        public TSource Convert(TSource source)
        {
            return source;
        }
    }

}
